home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr23 / tlxtw204.zip / GAMEDIR.SLT < prev    next >
Text File  |  1995-01-21  |  2KB  |  64 lines

  1. // Changes to the game's directory and runs the following command
  2. //
  3. str command[] = "lt";                                                        //
  4. ///////////////////////////////////////////////////////////////////////////////
  5. main()
  6. {
  7.     str bbsname[8], f1[64];
  8.     int i, osk;
  9.  
  10.     osk=_scr_chk_key;_scr_chk_key=0;
  11.     update_term();
  12.     if(!getenv("f1",f1)) {
  13.         status_wind("F1 environment variable not found",25);
  14.         _scr_chk_key=osk;
  15.         return 0;
  16.     }
  17.     append_backslash(f1);
  18.     if(!strlen(_entry_name))
  19.         if(call("bbsname") == -1) {
  20.         _scr_chk_key=osk;
  21.         return 0;
  22.     }
  23.     bbsname=_entry_name;
  24.     fill_spaces(bbsname);
  25.     strcat(f1, bbsname); strcat(f1, "\");
  26.     newdir(f1);
  27.     _scr_chk_key=osk;
  28.     cursor_onoff(1);
  29.     dos(command,0);
  30.     newdir(_telix_dir);
  31.     _scr_chk_key=osk;
  32.     return 1;
  33. }
  34. //////////////////////////////////////////////////////////////////////////////
  35. //               Filters out characters illegal in DOS filenames.
  36. fill_spaces( str bbsbuf )
  37. {
  38.     int i;
  39.     str chr[1];
  40.     int count = 0;
  41.     while (count < 6) {
  42.         if      (count == 0) chr = ".";
  43.         else if (count == 1) chr = "+";
  44.         else if (count == 2) chr = " ";
  45.         else if (count == 3) chr = "?";
  46.         else if (count == 4) chr = "*";
  47.         else if (count == 5) chr = "/";
  48.         i=0;
  49.         while (1) {
  50.             i = strpos(bbsbuf, chr, i);
  51.             if (i == -1) break;
  52.              setchr(bbsbuf, i ,'_');
  53.             i = i + 1;
  54.         } ++count;
  55.     } return bbsbuf;
  56. }
  57. ///////////////////////////////////////////////////////////////////////////////
  58. append_backslash( str string )
  59. {
  60.     if(subchr(string,strlen(string)-1)!='\')strcat(string,"\");
  61.     return string;
  62. }
  63. /////////////////////////////////////////////////////////////////////////////
  64.